package cn.tonyqiu.wonuly.dao.ibatis;

import java.util.List;

import cn.tonyqiu.wonuly.dao.LookupDao;
import cn.tonyqiu.wonuly.model.Account;
import cn.tonyqiu.wonuly.model.Category;

/**
 * iBatis implementation of LookupDao.
 * 
 * @author <a href="mailto:matt@raibledesigns.com">Matt Raible</a>
 */
public class LookupDaoiBatis extends UniversalDaoiBatis implements LookupDao {

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.tonyqiu.wonuly.dao.LookupDao#getAccountsByUser(int)
	 */
	@Override
	@SuppressWarnings("unchecked")
	public List<Account> getAccountsByUser(int userId) {
		return getSqlMapClientTemplate().queryForList("getAccountsByUserId",
				userId);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.tonyqiu.wonuly.dao.LookupDao#getCategoriesByUser(int)
	 */
	@Override
	@SuppressWarnings("unchecked")
	public List<Category> getCategoriesByUser(int userId) {

		return getSqlMapClientTemplate().queryForList("getCategoriesByUserId",
				userId);

	}
	

}
